 
let localContast = {
 
   
	HISTORY_SEARCH:"HISTORY_SEARCH",
	INDEX_AFTER_LOGIN_REFRESHED:"INDEX_AFTER_LOGIN_REFRESHED",
	USER_AFTER_LOGIN_REFRESHED:"USER_AFTER_LOGIN_REFRESHED",
	BASE_URL:"BASE_URL",
	USER_ID:"user-id",
	OPEN_ID:"open-id",

	OWNER_USER_ID:"owner-user-id",
	OWNER_TOKEN:"owner-user-token",
	SHOP_USER_ID:"shop_user_id",
	SELECT_CITY_ONCE:"select_city_once"
	
	
 
	
	
}



let local = {
	getImToken(){
			return this.get(localContast.USER_IM_RONG_TOKEN)||false;
		},
		setImToken(v){
			this.set(localContast.USER_IM_RONG_TOKEN,v);
		},
	
	getSelectCityOnce(){
		return this.get(localContast.SELECT_CITY_ONCE) || false;
	},
	setSelectCityOnce(v){
		this.set(localContast.SELECT_CITY_ONCE,v);
	},
	
	getShopUserId(){
		return this.get(localContast.SHOP_USER_ID) || false;
	},
	setShopUserId(v){
		this.set(localContast.SHOP_USER_ID,v);
	},
	
	
	 
	getUserId(){
		return this.get(localContast.USER_ID);
	},

	setUserId(v) {
		this.set(localContast.USER_ID, v);
	},
	
	getOwnerUserId(){
		return this.get(localContast.OWNER_USER_ID)||false;
	},
	setOwnerUserId(v){
		this.set(localContast.OWNER_USER_ID,v);
	},
	
	getOpenId(){
		return this.get(localContast.OPEN_ID)||false;
	},
	setOpenId(v){
		this.set(localContast.OPEN_ID,v);
	},
	
	
	
	
	getOwnerToken(){
		return this.get(localContast.OWNER_TOKEN) || false;
	},
	setOwnerToken(v){
		this.set(localContast.OWNER_TOKEN,v);
	},
	
	setBaseUrl(v){
		this.set(localContast.BASE_URL,v);
	},
	getBaseUrl(){
		if(typeof this.get(localContast.BASE_URL)){
			return this.get(localContast.BASE_URL)
		}
		return false;
	},
	setIndexAfterLoginRefeshed(v){
		this.set(localContast.INDEX_AFTER_LOGIN_REFRESHED,v);
	},
	getIndexAfterLoginRefeshed(){
		if(typeof this.get(localContast.INDEX_AFTER_LOGIN_REFRESHED) === "boolean"){
			return this.get(localContast.INDEX_AFTER_LOGIN_REFRESHED)
		}
		return true;
	},
	
	setUserAfterLoginRefeshed(v){
		this.set(localContast.USER_AFTER_LOGIN_REFRESHED,v);
	},
	getUserAfterLoginRefeshed(){
		if(typeof this.get(localContast.USER_AFTER_LOGIN_REFRESHED) === "boolean"){
			return this.get(localContast.USER_AFTER_LOGIN_REFRESHED)
		}
		return true;
	},
	
	
	setSearchHistory(v){
		this.set(localContast.HISTORY_SEARCH,v);
	},
	getSearchHistory(){
		return this.get(localContast.HISTORY_SEARCH)||[];
	},
	
	 set(key,data){
	 	try {
	 	    uni.setStorageSync(key,data);
	 	} catch (e) {
	 	    // error
	 	}
	 },
	 get(key){
	 	try {
	 	    return uni.getStorageSync(key);
	 	} catch (e) {
	 	    return null
	 	}
	 },
	 
}
export default local;
